/*=============================================================================
*
*   Copyright (C) 2020 All rights reserved.
*
*   Filename:		new_model.cpp
*
*   Author: Wang Zhecheng - wangzhecheng@yeah.net
*
*   Date: 2020-03-20 04:15
*
*   Last Editors: Wang Zhecheng - wangzhecheng@yeah.net
*
*   Last modified:	2020-03-29 16:56
*
*   Description:
*
=============================================================================*/
#include "../../include/fem.hpp"
#include "../../include/implicit_solver.hpp"
#include "../../include/incremental_load.hpp"
#include "../../include/io/data_extractor.hpp"
#include "../../include/io/vtu_writer.hpp"
#include "../../include/model/model2.hpp"
#include "../../include/solid.hpp"
#include "../../include/static_equation.hpp"

LOGGING_REGISTER()

int main(int argc, char* argv[]) {

  using namespace geoxfem;

  using MethodPolicy   = model::fem;
  using CouplePolicy   = model::solid;
  using DimensionType  = geometry::plane_strain;
  using EquationPolicy = model::static_equation;
  using SolvePolicy    = model::implicit_solver;
  using LoadPolicy     = model::incremental_load;
  using Model =
    geoxfem::model::Model<MethodPolicy, CouplePolicy, DimensionType,
                          EquationPolicy, SolvePolicy, LoadPolicy, mpl1>;

  std::string input_file_name = "test/test_P52/P52.json";

  /*  detail, trace, process, info, warning, debug, error }; */
  geoxfem::log::log_init(geoxfem::log::severity_level::info);

  io::DataParser<io::json> parser;
  parser.read(input_file_name);

  /* io::DataExtractor<Model> extractor; */
  /* extractor.init(parser); */

  io::DataWriter<Model, io::vtu> writer;
  writer.init(parser.getPath(), parser.getFileName());

  io::DataPloter ploter;

  Model model;
  /* model.append(extractor); */
  model.append(&writer);

  model.init(parser);
  model.buildProblem();
  /* model.solveProblem(); */

  model.plot(ploter);
  return 0;
}
